<template>
	<view class="box">
		<uNavbar title="玩法介绍" :leftIconColor="leftcolor" ></uNavbar>
		<view class="list">
			 <rich-text class="s" :nodes="article"></rich-text>
		</view>
	</view>
	
</template>

<script>
import {config} from "../../api/shopp.js"
	export default {

		data() {
			return {
				leftcolor:'#ffffff',
				article: ''//富文本内容
			}
		},
		onLoad(e){
			console.log(e);
			if(e.type){
				this.leftcolor = '#E0DDDA'
			}else{
				this.leftcolor = '#ffffff'
			}
			this.getlist()
		},
		methods: {
			getlist(){ 
				config().then(res=>{
					console.log(res)
						const regex = new RegExp('<img', 'gi');
						var htmlContent = res.data.gameplay_introduction
						htmlContent = htmlContent.replace(regex, `<img style="max-width: 100%;"`)
						this.article = htmlContent;
					// this.article=res.data.gameplay_introduction
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	
	.box {
		width: 100%;
		height: 100vh;
		background: #E0DDDA;
	}
	.list{
		margin-top: 40rpx;
		width: 94%;
		margin: 0 auto;
	}
	.s{
		color: #333 !important;
		opacity: 1;
	}
</style>
